package com.kgame5.xtank3d.control {
import kgame5.enginex.GameCommand;
import kgame5.k3d.util3d.Shaker;
import kgame5.kutil.T;

import com.kgame5.xtank3d.GameEnum;
import com.kgame5.xtank3d.effect.Eff3DManager;
import com.kgame5.xtank3d.vo.BlastVO;
import com.kgame5.xtank3d.vo.MyTankVO;

/**
 * @author kk
 * 卡车爆炸
 * TODO 这个还没加上呢
 */
public class CartBlastCommand extends GameCommand{
	public static const NAME:String="CartBlastCommand";

	override public function execute(data:Object) : void {
		T.p(NAME);
		
		//
		var tankVO:MyTankVO=data as MyTankVO;
		
		//删除
		gamePlay.removeEntity(tankVO.id);
		
		//通知外部有坦克死亡
				
		//爆炸
		var blastVO2:BlastVO=new BlastVO();
		blastVO2.type=GameEnum.BLAST_TYPE_NORMAL;//TODO 死亡动画
		blastVO2.posi= tankVO.hardVO.v3d_p.clone();
		blastVO2.posi.y=32;
		blastVO2.WAVE= tankVO.hardVO.bball.R*2;
		Eff3DManager.getInstance().BUDie(blastVO2.posi,tankVO.typeID);//TODO 坦克死亡动画
		
		//屏幕震动
		Shaker.getInstance().start(6, 6);
		
		//连锁爆炸
		this.sendCommand(BlastChainCommand.NAME, blastVO2);
	}
}//end of class
}